//
// Created by user on 2022/3/9.
//
#include <vector>
#include <unordered_map>
using namespace std;
vector<int> majorityElement(vector<int>& nums) {
    unordered_map<int, int> map;
    vector<int>res;
    for (int n:nums) {
        map[n]++;
    }
    for(auto & p : map){
        if(p.second>nums.size()/3){
            res.push_back(p.first);
        }
    }
    return res;

}